package com.vm.activity;

import com.wwtscapp.apk.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

/**
 * 
 * @ProjectName: [WeiMai]
 * @Author: [kent.wang]
 * @CreateDate: [2015年3月12日 下午4:49:16]
 * @Version: [v1.0]
 * 
 */
public class UserInfoActivity extends Activity {

	TextView tv_login;
	TextView tv_register;
	ImageView imgbtn_search_back;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login_register);

		init();
	}

	/**
	 * 
	 */
	private void init() {
		tv_login = (TextView) findViewById(R.id.tv_login);
		tv_login.setOnClickListener(btnClickListener);

		tv_register = (TextView) findViewById(R.id.tv_register);
		tv_register.setOnClickListener(btnClickListener);
		
		imgbtn_search_back = (ImageView) findViewById(R.id.imgbtn_search_back);
		imgbtn_search_back.setOnClickListener(btn_backListener);
	}

	public OnClickListener btnClickListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			if (v == tv_login) {
				Intent intent = new Intent(UserInfoActivity.this,LoginActivity.class);
				startActivity(intent);
				UserInfoActivity.this.finish();

			} else if (v == tv_register) {
				Intent intent = new Intent(UserInfoActivity.this,RegisterActivity.class);
				startActivity(intent);
				UserInfoActivity.this.finish();
				
			}

		}
	};
	
	/**
	 * imgbtn_search_back 返回按钮监听
	 */
	OnClickListener btn_backListener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			onBackPressed();
		}
	};

	/**
	 * 手机自带返回按钮监听
	 */
	@Override
	public void onBackPressed() {
		super.onBackPressed();

	}

}
